{% comment %}
<!--
  Copyright (C) 2008 ZHENG Zhong <http://www.zhengzhong.net/>

  Created on 2008-08-15.
  $Id$
-->
{% endcomment %}

<div id="description" class="ajax_box">

  {% include "foodsnroses/ajax/ajax_error.html" %}
  
  <!-- view _____________________________________________________________________________________-->
  
  <div class="view">
  
    {% if resto.description %}
      {{resto.description|escape|linebreaks}}
    {% else %}
      <span class="na">This resto has no description.</span>
    {% endif %}
    
    {% if resto.is_manageable %}
      <div class="toggle_link">
        <a href="javascript:void(0);" onclick="toggleBox('#description');">[edit]</a>
      </div>
    {% endif %}
  
  </div><!--/.view-->
  
  <!-- edit _____________________________________________________________________________________-->
  
  {% if resto.is_manageable %}
  
    <div class="edit hidden">
    
      <form id="update_description_form" class="form" action="." method="POST"
            onsubmit="return submitAjaxForm('#description', '#update_description_form')">
        <input type="hidden" name="ajax_box" value="description"/>
        <div>
          <textarea style="width: 450px; height: 240px;" name="description">{{resto.description|default:""|escape}}</textarea>
        </div>
        <div>
          <input class="button" type="submit" value="Update"/>
          <input class="button" type="button" onclick="toggleBox('#description');" value="Cancel"/>
          <span class="ajax_indicator hidden">
            <img src="{{static_}}/images/ajax_indicator.gif" alt="AJAX Indicator"/>
          </span>
        </div>
      </form>
    
    </div><!--/.edit-->
  
  {% endif %}

</div><!--/#description-->

